<?php
declare (strict_types=1);

namespace app\admin\logic\promotion;

use app\admin\model\promotion\PromotionBargainData as PromotionBargainDataModel;
use app\common\helper\util\Page;

/**
 * Class PromotionBargainData
 *
 * @package app\admin\logic\promotion
 */
class PromotionBargainData extends PromotionBargainDataModel
{
    /**
     * 获取列表
     * Author: Martinsun <syh@sunyonghong.com>
     * Date: 2021/4/22
     *
     * @param int $bargainId
     * @return \think\Paginator
     * @throws \think\db\exception\DbException
     */
    public function getBargainListById(int $bargainId)
    {
        return $this->where('bargain_id', $bargainId)->with(['user'])->paginate(Page::listRows());
    }
}